package com.flyan.game.motafx.config;

import com.flyan.game.motafx.core.map.MapPosition;
import javafx.geometry.Point2D;

/**
 * 游戏配置
 *
 * @author flyan
 * @version 1.0
 * @email flyan_by_chenu@sina.com
 * @since 2025/1/31
 */
public interface GameConfig {

    /**
     * 格子像素大小
     */
    int GRID_SIZE = 32;
    int GRID_BBOX_SIZE = GRID_SIZE / 2;

    /**
     * 地图配置
     */
    int MAP_GRID_COUNT = 11;
    int MAP_WIDTH = GRID_SIZE * MAP_GRID_COUNT;
    int MAP_HEIGHT = GRID_SIZE * MAP_GRID_COUNT;

    int HORIZONTAL_BORDER_SIZE = 16;
    int VERTICAL_BORDER_SIZE = 24;

    int STATUS_BAR_WIDTH = 128;
    int BACKGROUND_WIDTH = MAP_WIDTH + (HORIZONTAL_BORDER_SIZE * 2) + (STATUS_BAR_WIDTH * 2);
    int BACKGROUND_HEIGHT = MAP_HEIGHT + (VERTICAL_BORDER_SIZE * 2);

    Point2D MAP_BEGIN_COORDINATE = new Point2D(STATUS_BAR_WIDTH + HORIZONTAL_BORDER_SIZE, VERTICAL_BORDER_SIZE);
    Point2D MAP_END_COORDINATE = new Point2D(STATUS_BAR_WIDTH + HORIZONTAL_BORDER_SIZE + MAP_WIDTH, VERTICAL_BORDER_SIZE + MAP_HEIGHT);

    MapPosition BRAVE_INIT_POSITION = new MapPosition(11, 6);

    /**
     * 左侧信息栏目信息
     */
    int LEFT_INFO_PANE_WIDTH = STATUS_BAR_WIDTH;
    int LEFT_INFO_PANE_HEIGHT = BACKGROUND_HEIGHT;
    Point2D LEFT_INFO_PANE_FLOOR_COORDINATE = new Point2D(16, 48);
    Point2D LEFT_INFO_PANE_HP_COORDINATE = new Point2D(
            LEFT_INFO_PANE_FLOOR_COORDINATE.getX() + 26,
            LEFT_INFO_PANE_FLOOR_COORDINATE.getY() + 15);
    Point2D LEFT_INFO_PANE_ACK_COORDINATE = new Point2D(
            LEFT_INFO_PANE_HP_COORDINATE.getX(),
            LEFT_INFO_PANE_HP_COORDINATE.getY() + 10);
    Point2D LEFT_INFO_PANE_DEF_COORDINATE = new Point2D(
            LEFT_INFO_PANE_HP_COORDINATE.getX(),
            LEFT_INFO_PANE_ACK_COORDINATE.getY() + 10);
    Point2D LEFT_INFO_PANE_GOLD_COORDINATE = new Point2D(
            LEFT_INFO_PANE_HP_COORDINATE.getX(),
            LEFT_INFO_PANE_DEF_COORDINATE.getY() + 10);
    Point2D LEFT_INFO_PANE_ITEM_COORDINATE = new Point2D(
            LEFT_INFO_PANE_HP_COORDINATE.getX(),
            (double) BACKGROUND_HEIGHT / 2);

    /**
     * 右侧信息栏目信息
     */
    int RIGHT_INFO_PANE_WIDTH = STATUS_BAR_WIDTH;
    int RIGHT_INFO_PANE_HEIGHT = BACKGROUND_HEIGHT;
    Point2D RIGHT_INFO_PANE_BEGIN_COORDINATE = new Point2D(
            LEFT_INFO_PANE_WIDTH + MAP_WIDTH + (2 * HORIZONTAL_BORDER_SIZE)-2,
            0);
    Point2D RIGHT_INFO_PANE_ATTACK_EQUIP_TEXT_BEGIN_COORDINATE = new Point2D(
            HORIZONTAL_BORDER_SIZE,
            48
    );
    Point2D RIGHT_INFO_PANE_DEFENSE_EQUIP_TEXT_BEGIN_COORDINATE = new Point2D(
            RIGHT_INFO_PANE_ATTACK_EQUIP_TEXT_BEGIN_COORDINATE.getX(),
            RIGHT_INFO_PANE_ATTACK_EQUIP_TEXT_BEGIN_COORDINATE.getY() + GRID_SIZE
    );
    Point2D RIGHT_INFO_PANE_ATTACK_EQUIP_IMG_BEGIN_COORDINATE = new Point2D(
            RIGHT_INFO_PANE_ATTACK_EQUIP_TEXT_BEGIN_COORDINATE.getX() + ((double) GameConfig.RIGHT_INFO_PANE_WIDTH / 2),
            RIGHT_INFO_PANE_ATTACK_EQUIP_TEXT_BEGIN_COORDINATE.getY()
    );
    Point2D RIGHT_INFO_PANE_DEFENSE_EQUIP_IMG_BEGIN_COORDINATE = new Point2D(
            RIGHT_INFO_PANE_ATTACK_EQUIP_IMG_BEGIN_COORDINATE.getX(),
            RIGHT_INFO_PANE_ATTACK_EQUIP_IMG_BEGIN_COORDINATE.getY() + 48
    );
    Point2D RIGHT_INFO_PANE_KEY_BOX_BEGIN_COORDINATE = new Point2D(
            11,
            RIGHT_INFO_PANE_DEFENSE_EQUIP_TEXT_BEGIN_COORDINATE.getY() + 30);

    /**
     * 控制台
     */
    Point2D CONSOLE_COORDINATE = new Point2D(0, BACKGROUND_HEIGHT);
    int CONSOLE_HEIGHT = 31;

    /**
     * 交易页面
     */
    int TRANSACTION_PAGE_WIDTH = MAP_WIDTH - (GRID_SIZE * 2);
    int TRANSACTION_PAGE_HEIGHT = TRANSACTION_PAGE_WIDTH - GRID_SIZE  * 1;
    Point2D TRANSACTION_PAGE_BEGIN_COORDINATE = new Point2D(
            MAP_BEGIN_COORDINATE.getX() + GRID_SIZE,
            MAP_BEGIN_COORDINATE.getY() + GRID_SIZE * 2
    );

    /**
     * 最大背包容量
     */
    int MAX_BACKPACK_SIZE = 1000;

}
